﻿using FastReport;
using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using 无人值守地磅称重系统.Interfaces;

namespace 无人值守地磅称重系统.Views
{
    /// <summary>
    /// DesignWindow.xaml 的交互逻辑
    /// </summary>
    public partial class DesignWindow : MetroWindow
    {
        private FastReport.Design.StandardDesigner.DesignerControl designControl = new FastReport.Design.StandardDesigner.DesignerControl();
        private Report report = new Report();

        public DesignWindow(IConfigService configService)
        {
            InitializeComponent();
            if (File.Exists(configService.SystemConfig.Template))
            {
                report.Load(configService.SystemConfig.Template);
            }
            designControl.Report = report;
            designControl.RefreshLayout();
            host.Child= designControl;
        }
    }
}
